/*
 * (C) Copyright 2012, by Tim Xie.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.superapk.diamond.sqllite.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 注解： 标注一个类型是数据库的属性
 * 
 * <p>
 * 该注解必须配合  @DBTabel 注解使用，只要为字段标注 @DBField 注解，程序会自动尝试转换成数据库
 * 对应的字段
 * <p>
 * 
 * @author     Tim Xie [tim.xie2008@gmail.com]
 * @date       2013-3-14
 * 
 */

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME) 
public @interface DBField {
	
	public static final String KEYWORDS_STRING = "__ormlite__ no default value string was specified";
	/**
	 * 标记数据库的字段名
	 * @return
	 */
	public String column() default "";
	/**
	 * 标记数据库字段的默认值
	 * @return
	 */
	public String defaultValue() default "";
	/**
	 * 标记自动增长Id
	 * @return
	 */
	boolean generatedId() default false;
	/**
	 * 标记外键约束
	 * @return
	 */
	boolean foreign() default false;
	/**
	 * 标记该字段是唯一
	 * @return
	 */
	boolean unique() default false;
	
}
